ASSUME CS:CODE
;EXCHANGE FROM H TO D 
;2024/12/26 TIANLANG
;BEFORE THAT,SHOULD RECEIVE USER INPUT VALUABLE ENTITY
CODE SEGMENT
START:
	MOV BX,0
	MOV CL,4
RECEIVE_DATA:
	MOV AH,1
	INT 21H
	SUB AL,30H
	CMP AL,0;IF USER INPUT ENTERKEY
	JL OUTPUT_DATA
	CMP AL,9H
	JLE STORE_DATA;STORE 0~9 
	SUB AL,7H
	CMP AL,0AH
	JL OUTPUT_DATA
	CMP AL,10H
	JGE OUTPUT_DATA;EXCEPT OTHER SYMBOL 
STORE_DATA:
	ROL BX,CL
	;AND AL,0FH
	MOV AH,0
	ADD BX,AX
	JMP RECEIVE_DATA
OUTPUT_DATA:
	;CIRCLE OUTPUT 
	MOV CH,4
OUTPUT:
	ROL BX,CL
	MOV AL,BL
	AND AL,0FH
	ADD AL,30H
	CMP AL,3AH
	JL OUTPUT_SERVICE
	ADD AL,7H
OUTPUT_SERVICE:
	MOV DL,AL
	MOV AH,02H
	INT 21H
	DEC CH
	JNZ OUTPUT
	
	MOV DL,'H'
	MOV AH,02H
	INT 21H
	MOV AX,4C00H
	INT 21H
CODE ENDS
END START
	